package com.wc.alorithm_blue_bridge._动态规划.线性DP.数组问题;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/21 16:55
 * @description https://www.lanqiao.cn/problems/8512/learning/?page=1&first_category_id=1
 */
public class Main {
    static int N = 1010, M = 15;
    // f1[i][j] 限制取i个数，最大为j的方案数
    static int[][] f = new int[M][N];

    // f1[i]的阶乘和
    static long[] f1 = new long[N];

    static int P = (int) 1e9 + 7;
    static int n, m;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for (int i = 1; i < N; i++) f[1][i] = 1;
        for (int i = 2; i < M; i++) {
            for (int j = 1; j < N; j++) {
                for (int k = 1; k <= j; k++) {
                    f[i][j] = (f[i][j] + f[i - 1][k]) % P;
                }
            }
        }
        f1[0] = 1;
        for (int i = 1; i < N; i++) f1[i] = f1[i - 1] * i % P;
//        for (int i = 2; i < N; i++) f1[i] = (f1[i] + f1[i - 1]) % P;
        n = sc.nextInt();
        m = sc.nextInt();
        long ans = 0;
        for (int i = 1; i <= n; i++) {
            for (int j = i; j <= n; j++) {
                ans = ((long) f[m][i] * f1[n - j + 1] + ans) % P;
            }
        }
        System.out.println(ans);
    }
}
